package com.ruoyi.wjq.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.fk.domain.Question;
import com.ruoyi.fk.domain.QuestionBank;
import com.ruoyi.youyou.domain.SysYouYouUser;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 错题对象 wrong_question
 * 
 * @author wjq
 * @date 2025-08-13
 */
public class WrongQuestion extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 记录ID */
    private Long id;

    /** 用户ID */
    @Excel(name = "用户ID")
    private Long userId;

    /** 题目ID */
    @Excel(name = "题目ID")
    private Long questionId;

    /** 题库ID */
    @Excel(name = "题库ID")
    private Long questionBankId;

    /** 错误次数 */
    @Excel(name = "错误次数")
    private Long wrongTimes;

    /** 最后错误时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "最后错误时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date lastWrongTime;

    /** 0为删除，1为保存 */
    private Long del;

    private SysYouYouUser sysYouYouUser;
    private Question question;
    private QuestionBank questionBank;

    // 新增：仅用于查询的字段（不映射数据库，纯粹条件）
    private String nickName; // 仅用于查询的用户昵称
    private String title;    // 仅用于查询的题目标题
    private String name;

    public SysYouYouUser getSysYouYouUser() {
        return sysYouYouUser;
    }

    public void setSysYouYouUser(SysYouYouUser sysYouYouUser) {
        this.sysYouYouUser = sysYouYouUser;
    }

    public Question getQuestion() {
        return question;
    }

    public void setQuestion(Question question) {
        this.question = question;
    }

    public QuestionBank getQuestionBank() {
        return questionBank;
    }

    public void setQuestionBank(QuestionBank questionBank) {
        this.questionBank = questionBank;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }

    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }

    public void setQuestionId(Long questionId) 
    {
        this.questionId = questionId;
    }

    public Long getQuestionId() 
    {
        return questionId;
    }

    public void setQuestionBankId(Long questionBankId) 
    {
        this.questionBankId = questionBankId;
    }

    public Long getQuestionBankId() 
    {
        return questionBankId;
    }

    public void setWrongTimes(Long wrongTimes) 
    {
        this.wrongTimes = wrongTimes;
    }

    public Long getWrongTimes() 
    {
        return wrongTimes;
    }

    public void setLastWrongTime(Date lastWrongTime) 
    {
        this.lastWrongTime = lastWrongTime;
    }

    public Date getLastWrongTime() 
    {
        return lastWrongTime;
    }

    public void setDel(Long del) 
    {
        this.del = del;
    }

    public Long getDel() 
    {
        return del;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("userId", getUserId())
            .append("questionId", getQuestionId())
            .append("questionBankId", getQuestionBankId())
            .append("wrongTimes", getWrongTimes())
            .append("lastWrongTime", getLastWrongTime())
            .append("createTime", getCreateTime())
            .append("del", getDel())
            .append("sysYouYouUser", getSysYouYouUser())   // 新增关联对象打印
            .append("question", getQuestion()) // 新增关联对象打印
            .append("questionBank", getQuestionBank()) // 新增关联对象打印
            .append("nickName", getNickName()) // 打印查询用的昵称
            .append("title", getTitle())       // 打印查询用的标题
            .append("name", getName())       // 打印查询用的题库名称
            .toString();
    }
}
